//
//  BSSCreditRatingViewController.m
//  PreschoolEducation
//
//  Created by 李传铎 on 2020/11/14.
//  Copyright © 2020 李传铎. All rights reserved.
//

#import "BSSCreditRatingViewController.h"

@interface BSSCreditRatingViewController ()<UIScrollViewDelegate>
@property (nonatomic ,strong) UIScrollView *scrollView;
@end

@implementation BSSCreditRatingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    [self creatUI];
}
- (void)creatUI{
    [self.view addSubview:self.scrollView];
    [self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.mas_equalTo(__kNavigationBarHeight__);
        make.bottom.mas_equalTo(0);
    }];
    UILabel *ratingInstructionslabel = [[UILabel alloc]init];
    [self.scrollView addSubview:ratingInstructionslabel];
    ratingInstructionslabel.text = @"等级说明";
    ratingInstructionslabel.textColor = colorCode(@"333333");
    ratingInstructionslabel.font = [UIFont boldSystemFontOfSize:16];
    
    [ratingInstructionslabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(20);
        
    }];
    
    UILabel *instructionslabel = [[UILabel alloc]init];
    [self.scrollView addSubview:instructionslabel];
    instructionslabel.text = @"根据商家在平台的经营表现，定时更新信用等级，信用等级直接影响商家在平台课程/服务的最高定价。";
    instructionslabel.textColor = colorCode(@"333333");
    instructionslabel.font = fontCount(14);
    instructionslabel.numberOfLines = 0;
    
    [instructionslabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.right.mas_equalTo(self.view.mas_right).offset(-15);
        make.top.mas_equalTo(ratingInstructionslabel.mas_bottom).offset(10);
    }];
    
    UILabel *instructionslabel1 = [[UILabel alloc]init];
    [self.scrollView addSubview:instructionslabel1];
    instructionslabel1.text = @"园所等级";
    instructionslabel1.textColor = colorCode(@"333333");
    instructionslabel1.font = [UIFont boldSystemFontOfSize:16];
    
    [instructionslabel1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(instructionslabel.mas_bottom).offset(10);
    }];
    UIImage *image1 = imageNameStr(@"pic_yuansuo");
    UIImageView *instructionsImage1 = [[UIImageView alloc]init];
    [self.scrollView addSubview:instructionsImage1];
    instructionsImage1.image = image1;
    
    [instructionsImage1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(instructionslabel1.mas_bottom).offset(15);
        make.height.mas_equalTo(image1.size.height);
        make.width.mas_equalTo(image1.size.width);
    }];
    
    UILabel *instructionslabel2 = [[UILabel alloc]init];
    [self.scrollView addSubview:instructionslabel2];
    instructionslabel2.text = @"服务机构";
    instructionslabel2.textColor = colorCode(@"333333");
    instructionslabel2.font = [UIFont boldSystemFontOfSize:16];
    
    [instructionslabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(instructionsImage1.mas_bottom).offset(10);
    }];
    
    UIImage *image2 = imageNameStr(@"pic_fuwu");
    UIImageView *instructionsImage2 = [[UIImageView alloc]init];
    [self.scrollView addSubview:instructionsImage2];
    instructionsImage2.image = image2;
    
    [instructionsImage2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(instructionslabel2.mas_bottom).offset(15);
        make.height.mas_equalTo(image2.size.height);
        make.width.mas_equalTo(image2.size.width);
    }];
    
    UILabel *instructionslabel3 = [[UILabel alloc]init];
    [self.scrollView addSubview:instructionslabel3];
    instructionslabel3.text = @"服务个人";
    instructionslabel3.textColor = colorCode(@"333333");
    instructionslabel3.font = [UIFont boldSystemFontOfSize:16];
    
    [instructionslabel3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(instructionsImage2.mas_bottom).offset(10);
    }];
    
    UIImage *image3 = imageNameStr(@"pic_geren");
    UIImageView *instructionsImage3 = [[UIImageView alloc]init];
    [self.scrollView addSubview:instructionsImage3];
    instructionsImage3.image = image3;
    
    [instructionsImage3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.top.mas_equalTo(instructionslabel3.mas_bottom).offset(15);
        make.height.mas_equalTo(image3.size.height);
        make.width.mas_equalTo(image3.size.width);
    }];
    [_scrollView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(instructionsImage3.mas_bottom).offset(5);
    }];
}
- (UIScrollView *)scrollView{
    if (!_scrollView) {
        _scrollView = [[UIScrollView alloc]init];
        
        _scrollView.showsHorizontalScrollIndicator = NO;
        _scrollView.delegate = self;
        _scrollView.bounces = NO;
        //        self.scrollView.scrollEnabled = NO;
        _scrollView.pagingEnabled = YES;
        _scrollView.contentOffset = CGPointZero;
    }
    return _scrollView;
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
